package com.maimao.model.order.confirm;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 确认订单展示的可用优惠券基本信息
 *
 * @author MaoLin Wang
 * @date 2021/1/16 9:45 上午
 */
@AllArgsConstructor
@NoArgsConstructor
@Setter
@Getter
public class CouponSimple implements Serializable {

    private static final long serialVersionUID = -1204833668824332754L;

    @JsonFormat(shape = JsonFormat.Shape.STRING)
    private Long couponId;

    private BigDecimal discount;

    /**
     * 1 满减 2 立减
     */
    private Integer what;

    /**
     * 满减门槛
     */
    private BigDecimal min;

    /**
     * 是否为可用的最大优惠
     */
    private Boolean max=false;

    @Override
    public String toString() {
        return "CouponSimple{" +
                "couponId=" + couponId +
                ", discount=" + discount +
                ", what=" + what +
                ", max=" + max +
                ", min=" + min +
                '}';
    }
}
